<%--
  Created by IntelliJ IDEA.
  User: HELLO
  Date: 2019/12/12
  Time: 15:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <script src="../static/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/js/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="/static/js/update.js" type="text/javascript"></script>
</head>
<body>
<div class="container" style="margin-top: 50px; width: 30%;">
    <h3 class="text-center">更新新闻内容</h3>
    <form role="form" action="/detail/Update" method="post">
        <input type="hidden" value="${detail.id}" name="id">
        <div class="form-group">
            <labelid for="id">新闻编号(*)</labelid>
            <p name="id" type="text" class="form-control" value="${detail.id}" id="id">${detail.id}</p>
        </div>
        <div class="form-group">
            <label>新闻分类(*)</label>

            <c:if test="${detail.categoryId=='1'}">
            <select name="categoryId">
                <option value="1" selected="selected">军事</option>
                <option value="2">国内</option>
                <option value="3">国际</option>
            </select>
            </c:if>
            <c:if test="${detail.categoryId=='2'}">
                <select name="categoryId">
                    <option value="1">军事</option>
                    <option value="2">国内</option>
                    <option value="3" selected="selected">国际</option>
                </select>
            </c:if>
            <c:if test="${detail.categoryId=='3'}">
                <select name="categoryId">
                    <option value="1">军事</option>
                    <option value="2">国内</option>
                    <option value="3" selected="selected">国际</option>
                </select>
            </c:if>
        </div>


        <div class="form-group">
            <label for="title">新聞标题(*)</label>
            <input name="title" type="text" class="form-control" id="title" value="${detail.title}"><span id="msg"></span>
        </div>
        <div class="form-group">
            <label for="summary">新闻摘要(*)</label>
            <input name="summary" type="text" class="form-control" id="summary" value="${detail.summary}">
        </div>
        <div class="form-group">
            <label for="author">作者</label>
            <input name="author" type="text" class="form-control" id="author" value="${detail.author}">
        </div>
        <button type="submit" class="btn btn-danger">提交</button>
        <button type="button" onclick="history.back()" class="btn btn-danger">返回</button>
    </form>
</div>
</body>
</html>
